﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Chaliy.DbPro.Generators.TextAuthoring;

namespace Chaliy.DbPro.Generators.Tests.TextAuthoring
{
	[TestClass]
	public class RandomTextAuthorFactoryTests
	{
		[TestMethod]
		[DeploymentItem(DeploymentConstants.GeneratorsDll)]
		public void TestDefaultConfigurationCreate()
		{
			RandomTextAuthorFactory factory = new RandomTextAuthorFactory(
				ConfigurationUnitilities.CreateDefault()
				);

			ITextAuthor author = factory.Create();

			Assert.IsNotNull(author);
		}

		[TestMethod]
		[DeploymentItem(DeploymentConstants.GeneratorsDll)]
		[ExpectedException(typeof(ArgumentNullException))]
		public void TestConstructorWithEmptyArgument()
		{
			// Expecitn exception here because 
			// author cannot work without configuration
			new RandomTextAuthorFactory(null);
		}
	}
}
